<template>
  <div>
    <el-form label-width="120px" :model="formData">
      <el-form-item label="Id">
        <el-input v-model="formData.id" disabled class="inputid"></el-input>
      </el-form-item>
      <el-form-item label="名称">
        <el-input v-model="formData.text"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    nodeData: Object,
    lf: Object || String,
  },
  data () {
    return {
      formData: {
        id:'',
        name:'',
        text:'',
        type:'bpmn:exclusiveGateway'
      },
    }
  },
  mounted() {
    const { properties, text,id } = this.$props.nodeData
    if (properties) {
      this.$data.formData = Object.assign({}, this.$data.formData, properties)
    }
    if (text && text.value) {
      this.$data.formData.text = text.value
    }
    if (id ) {
      this.$data.formData.id = id
    }
  }, 
  methods: {
    save() {
      const { id } = this.$props.nodeData
      this.$props.lf.updateText(id, this.$data.formData.text);
      this.$emit('onClose')
    },
  }
}
</script>
<style scoped>
.inputid{
  width: 200px;
  margin-right: 10px;
}
</style>
